﻿using System;

namespace MC.EventHandler.Install
{
    public class Installer
    {
        static void Main(string[] args)
        {
            var config = CaptureArguments(args);
            if(config.AnyRequiredValuesBlank())
            {
                //Show GUI
                ConfigUI gui = new ConfigUI(config);
                gui.ShowDialog();
            }else
            {
                var installer = new InstallExecutor(config);
                installer.Notification += installer_Notification;
                installer.Install();
            }
        }

        static void installer_Notification(object sender, string message)
        {
            Console.WriteLine(message);
        }

        private static InstallationConfiguration CaptureArguments(string[] args)
        {
            return InstallationConfiguration.Parse(args);
        }
    }
}